﻿<%template _header%>
<%namespace YouHP.Model%>
<%namespace YouHP.BLL%>
<%namespace YouHP.Model.Group%>
<%namespace YouHP.Utility%>

<script type="text/javascript">
		var curtab = "symptom";
		function swapTab(tab, type)
		{
             var ctrl = _$("ui-" + curtab);
			 ctrl.style.display = 'none';
			 ctrl = _$("ui-" + tab);
			 ctrl.style.display = 'block';
			 curtab = tab;
			 _$("searchtype").value = type ;
		}
		
        function checkform()
        { 
            var str ="";           
            switch(parseInt(_$("searchtype").value))
            {
                case 0:
                    str="symname="+_$("symptomname").value.escUrl();
                    break ;
                case 1:
                    str="dszid="+_$("dszid").options[_$("dszid").selectedIndex].value;
                    break ;                    
            }
            location.href = "/Pages/Alpha/SymptomList.aspx?"+str;
        }
                  
            	
 </script>
<div class="layout-cols2">
	
<div class="col1">
		
 <%csharp%>TempUrl = ModuleCtrl.Header4("SymptomSearch","搜索症状",false,false); <%/csharp%>
{TempUrl}
<div  style="padding:5px 10px;">
    <div id="search-links" class="searchbox">
    <img src="/support/Alpha/images/icon_search_results.gif" />
			  <label>搜索条件：</label>
 <a href="#" id="A1" name="symptom" onclick="swapTab('symptom',0);">按症状名</a> |     
 <a href="#" id="lnk-age"name="disease" onclick="swapTab('disease',1);">按疾病名</a> 
 <input type="hidden" id="searchtype" value="0" />

    </div>
    <div id="search-ui">
      <%csharp%>TempUrl="/SymptomList.aspx";<%/csharp%>
        <form  id="postform" onsubmit="javascript:checkform();return false;" >
        <table>
            <tr>
            <td width="10px"></td>
                <td width="400">
                    <div id="ui-symptom" style="display:block;float:left;">
                        症状：
                        <input type="text" id="symptomname" name="symptomname" length="20">
                    </div>
                    <div id="ui-disease" style="display: none;float:left;">
                        疾病:
                        <select id="dszid" name="dszid">
                            <option value="" selected>请选择</option>
                            <%csharp%>
                            foreach( DiseaseInfo Info in DiseaseLst) {
                            <%/csharp%>
                            <option value="{Info.Id}">{Info.Name}</option>
                            <%csharp%>
                            }
                            <%/csharp%>
                        </select>
                    </div>
                       &nbsp;&nbsp; <input id="post" type="button" value="搜索" class="button1" onclick="checkform()" />
                </td>

            </tr>
        </table> 
      
        </form>
        
    </div>
</div>
 <%csharp%>TempUrl = ModuleCtrl.Footer("SymptomSearch"); <%/csharp%>
 {TempUrl}
	


 <%csharp%>TempUrl = ModuleCtrl.Header4("SymptomList","症状列表",false,false); <%/csharp%>
{TempUrl}

				<%csharp%> if(SymptomDataList.Count == 0){ <%/csharp%>

				    <div class="content">
				<p><b>找不到相应的症状!!</b></p>
				</div>

				<%csharp%> } else { <%/csharp%>
				<table border="0" cellpadding="0" cellspacing="0"  class="plist">
	                   <trstyle="height:30px;"> 
                        <td width="15%" height="26"><b class="tdtitle">症状名称</b></td>

                        <td width="35%" align="center"><b class="tdtitle">症状简介</b></td>
                        <td  align="center"  width="10%"><b class="tdtitle">总人数</b></td>

                        <td  align="center"  width="15%"><b class="tdtitle"> 典型病友</b></td>

                        </tr>
				<%csharp%>
				string str="tr_bgcolor_0";
				foreach(SymptomInfo item in SymptomDataList) { <%/csharp%>
					<tbody>
					<tr height="60" class="{str}">
					    <%csharp%>TempUrl = "/Symptom.aspx?id=" + item.Id; <%/csharp%>
						<td width="105"><a href="{this.GetUrl(TempUrl)}">{item.Name}</a></td>
						<%csharp%>
						string sb=item.Intro; 
						if(sb.Length==0){sb="暂无简介";}
						if(sb.Length>50){
						sb=sb.Substring(0,Math.Min(50,sb.Length))+"……";}
						<%/csharp%>
						<td style="padding:0px 10px 0px 10px;"><span style="text-overflow:ellipsis;">{sb}</span></td>
						
						<%csharp%> 
						    TempUrl="/PatientList.aspx?symid="+item.Id ;
						    if(item.PatientCount > 0)
						    {
						<%/csharp%>						
						<td align="center"><a href="{this.GetUrl(TempUrl)}"><font color="blue">{item.PatientCount}</a></font></td> 
						<%csharp%> 
                            }
                            else{
						<%/csharp%>	
                        <td align="center">{item.PatientCount}</td> 
						<%csharp%> 
                            }
    					<%/csharp%>	
						
						<td align="center">
						    <%csharp%>
						    if(item.PatientId > 0)
						    {
						        TempUrl = "/Profile/Index.aspx?uid=" + item.PatientId; 
						    <%/csharp%>
							    <a href="{this.GetUrl(TempUrl)}" class="user_img"><img src="{UserBLL.Instance.GetUserInfo(item.PatientId).Avatar}" height="48" width="48"></img><br />
							    {item.PatientName}
							    </a>
							<%csharp%>	}else {	<%/csharp%>
							    暂无
							<%csharp%> 
							} 
							<%/csharp%>
						</td>						
					</tr></tbody>
					<%csharp%>
					if(str=="tr_bgcolor_0") str="tr_bgcolor_1";
					else str="tr_bgcolor_0";
					}<%/csharp%>
				</table>				
				<%csharp%> } <%/csharp%>
<%csharp%>TempUrl = ModuleCtrl.Footer("SymptomList"); <%/csharp%>
{TempUrl}		
		
		<div class="box">
			<div class="content">
				<div class="pages">
					{SymptomPagingString}
				</div>
			</div>
		</div>
		
	</div>
	
	<div class="col2">
    
    <%template _BestFitPatientsBySymptoms%>
    <%template _HighIncidenceSymptomsOfDisease%>
    <%template _TopicHottest%>
		
	</div>
	
</div>

<%template _footer%>		
